#ifndef LIST_H_INCLUDED
#define LIST_H_INCLUDED

typedef     struct   List_t List;

typedef     struct ListsIter_t*  ListIter ;

int         ListIsEmpty(List* _list);/*return 1 if empty else 0*/

ListIter    ListBegin(List* _list);

ListIter    ListEnd(List* _list);/*return iterator to the end stub*/

void*       ListGetData(ListIter _iter);/*No iterator chekout*/

ListIter    ListInsert(List *_list,ListIter _iter,void* _data);/*insert before _iter and return iter to the new iter*/

ListIter    ListIterNext(ListIter _iter);/*++iter with no iter bound chekout */

ListIter    ListIterPrev(ListIter _iter);/*--iter with no iter bound chekout  */

List*       ListNew(void);

void        listDestroy(List* _list);/*will free the container*/

ListIter    ListRemove(List *_list,ListIter _iter);/*remove iter and return  next after removed iter */

int         ListIterIsEqual(ListIter , ListIter);

/*  Count the list items. Works in complexibility of O(n)               */
size_t  ListCount(List*)        ;

typedef int(*Func)(void* _data, void* _param);
void ListForEach(ListIter _beginIt, ListIter _endIt, Func, void* _param);

/*add is iter equal*/
#endif
